﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the Microsoft Public License (Ms-PL).
// See accompanying file License.txt or copy at http://mews.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Mews.Application
{
    using System.Globalization;

    using Mews.Application.Properties;

    /// <summary>Provides the means to get a message for the most common network connection states.</summary>
    internal static class ConnectionFailedHelper
    {
        internal static string GetStatusMessage(NetworkConnectionStatus status)
        {
            switch (status)
            {
                case NetworkConnectionStatus.NoPathToDestination:
                    return Resources.ConnectionFailedNoPathToDestination;
                case NetworkConnectionStatus.WaitingForPath:
                    return Resources.ConnectionFailedWaitingForPath;
                case NetworkConnectionStatus.WaitingForPhone:
                    return Resources.ConnectionFailedWaitingForPhone;
                case NetworkConnectionStatus.PhoneOff:
                    return Resources.ConnectionFailedPhoneOff;
                case NetworkConnectionStatus.ExclusiveConflict:
                    return Resources.ConnectionFailedExclusiveConflict;
                case NetworkConnectionStatus.NoResources:
                    return Resources.ConnectionFailedNoResources;
                case NetworkConnectionStatus.AuthenticationFailed:
                    return Resources.ConnectionFailedAuthenticationFailed;
                case NetworkConnectionStatus.WaitingForResource:
                    return Resources.ConnectionFailedWaitingForResource;
                default:
                    return string.Format(CultureInfo.InvariantCulture, Resources.ConnectionFailedUnknownReason, status);
            }
        }
    }
}
